package com.xbongbong.pro.service.cool.app;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.pojo.dto.StartProcessDTO;
import com.xbongbong.paas.pojo.vo.StartProcessVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.coolapp.pojo.CardDataPojo;
import com.xbongbong.pro.coolapp.pojo.CardDataProcessUpdatePojo;
import com.xbongbong.pro.coolapp.pojo.CardProcessWorkflowPojo;
import com.xbongbong.pro.coolapp.pojo.dto.CoolAppSendCardDTO;
import com.xbongbong.pro.coolapp.pojo.dto.CoolAppWorkflowCardDTO;
import com.xbongbong.saas.domain.entity.CoolAppCardDataEntity;

import java.util.List;

/**
 * @author 吴峰
 * @date 2022/08/12 15:12
 */
public interface CoolAppProcessCardService {

    void coolAppCard(StartProcessDTO startProcessDTO, StartProcessVO startProcessVO);

    /**
     * 发送审批卡片
     *
     * @param coolAppWorkflowCardDTO 入参
     * @return
     * @throws XbbException
     */
    BaseVO sendProcessCard(CoolAppWorkflowCardDTO coolAppWorkflowCardDTO) throws XbbException;

    void sendProcessOrWorkflow(String corpid, CoolAppCardDataEntity cardDataEntity, CoolAppCardDataEntity topCardDataEntity,
                               CoolAppSendCardDTO coolAppSendCardDTO, CardProcessWorkflowPojo cardProcessWorkflowPojo);


    CardDataPojo getProcessOrWorkflowCardData(String corpid, CoolAppCardDataEntity cardDataEntity, CoolAppSendCardDTO coolAppSendCardDTO,
                                              CardProcessWorkflowPojo cardProcessWorkflowPojo, List<String> receiverUserIdList, boolean topCardFlag, CardDataProcessUpdatePojo updatePojo) throws XbbException;

    CoolAppCardDataEntity saveCardData(CoolAppSendCardDTO coolAppSendCardDTO, String cardId, JSONArray receiverUserIds, String creatorId, String parentCardBizId, Long sourceDataId, JSONObject processNode) throws XbbException;

    CardProcessWorkflowPojo getProcessOrWorkflow(CoolAppWorkflowCardDTO coolAppWorkflowCardDTO, boolean workflow, boolean isEnd) throws XbbException;

}
